<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');

    $router->resource('users', 'UserController');
    $router->resource('units', 'UnitController');
    $router->resource('categories', 'CategoryController');
    $router->resource('questions', 'QuestionController');
    $router->resource('statistics', 'StatisticController');
    $router->resource('settings', 'SettingController');

    // 导入用户
    $router->post('users/import', 'UserController@import');

    // 导入题库
    $router->post('questions/import', 'QuestionController@import');

});
